/******************************************************************************
 * Copyright (C) 2017 Chengdu Dlhd information industry co. LTD.
 * All Rights Reserved.
 * 本软件为成都顶联互动信息产业有限公司开发研制。未经本公司正式书面同意，其他任何个人、团体不得使用、复制、修改或发布本软件.
 *****************************************************************************/
package net.dgg.dggcloud.service.jrcrm.entity.business;

import net.dgg.dggcloud.service.entity.BaseEntity;
import net.dgg.dggcloud.service.jrcrm.utils.BusinessStatusUtil;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @ClassName 〈Business>
 * @Description 商机转介绍实体
 * @Author 罗金
 * @Date 2018/1/11 11:37
 */
@Entity
@Table(name = "bus_business_referral")
public class BusinessReferral extends BaseEntity{


    public static final String TABLE_NAME = "bus_business_referral";

    /**
     * 商机转介绍人Id
     */
    @Column(name = "referral_user_id")
    private Long referralUserId;

    /**
     * 商机转介绍人org
     */
    @Column(name = "referral_org_id")
    private Long referralOrgId;

    /**
     * 商机转介绍人名称
     */
    @Column(name = "referral_user_name")
    private String referralUserName;

    /**
     * 接收人id
     */
    @Column(name = "receive_user_id")
    private Long receiveUserId;

    /**
     * 接收人org
     */
    @Column(name = "receive_org_id")
    private Long receiveOrgId;


    /**
     * 接收人名称
     */
    @Column(name = "receive_user_name")
    private String receiveUserName;

    /**
     * 奖励方式
     */
    @Column(name = "reward_way")
    private String rewardWay;

    /**
     * 红包
     */
    @Column(name = "referral_red")
    private Long referralRed;
    @Transient
    private BigDecimal red;

    @Transient
    private BigDecimal istcred;

    /**
     * 业绩划分比列
     */
    @Column(name = "performance_proportion")
    private Long performanceProportion;

    /**
     * 红包提成比列
     */
    @Column(name = "tc_proportion")
    private Long tcProportion;

    /**
     * 客户需求
     */
    @Column(name = "costomer_demand")
    private String costomerDemand;

    /**
     * 备注
     */
    @Column(name = "remark")
    private String remark;

    /**
     * 是否接收
     * @return
     */
    @Column(name="is_receive")
    private Integer isReceive;

    /**
     * 当前退回人Name
     * @return
     */
    @Column(name="current_return_user_name")
    private String currentReturnUserName;

    /**
     * 当前退回人ID
     * @return
     */
    @Column(name="current_return_user_id")
    private Long currentReturnUserId;

    /**
     * 当前退回人org
     * @return
     */
    @Column(name="current_return_org_id")
    private Long currentReturnOrgId;


    /**
     * 退回时间
     * @return
     */
    @Column(name="return_time")
    private Date returnTime;

    /**
     * 退回次数
     * @return
     */
    @Column(name="return_num")
    private Integer returnNum;
    @Column(name="is_fa")
    private Integer isFa;
    @Column(name="tcred")
    private Integer tcred;

    @Column(name = "fa_time")
    private Date faTime;

    @Column(name = "referral_time")
    private Date referralTime;

    @Column(name = "customer_id")
    private Long customerId;

    /**
     * 质检库审核状态0待审核1审核通过2删除
     */
    @Column(name="referral_audit_status")
    private Integer referralAuditStatus;

    /**
     * 创建类型1质检创建2商务创建
     */
    @Column(name="create_type")
    private Integer createType;

    /**
     * 审核人id
     */
    @Column(name="audit_user_id")
    private Long auditUserId;

    @Column(name="referral_type")
    private String referralType;



    public Long getReferralOrganizationId() {
        return referralOrganizationId;
    }

    public BusinessReferral setReferralOrganizationId(Long referralOrganizationId) {
        this.referralOrganizationId = referralOrganizationId;
        return this;
    }

    public String getReferralOrganizationName() {
        return referralOrganizationName;
    }

    public BusinessReferral setReferralOrganizationName(String referralOrganizationName) {
        this.referralOrganizationName = referralOrganizationName;
        return this;
    }

    @Column(name="referral_organization_id")

    private  Long referralOrganizationId;
    @Column(name="referral_organization_name")
    private  String referralOrganizationName;

    public static String getTableName() {
        return TABLE_NAME;
    }




    public String getRewardWay() {
        return rewardWay;
    }

    public BusinessReferral setRewardWay(String rewardWay) {
        this.rewardWay = rewardWay;
        return this;
    }

    public Long getReferralRed() {
        return referralRed;
    }

    public BusinessReferral setReferralRed(Long referralRed) {
        this.referralRed = referralRed;
        return this;
    }

    public Long getPerformanceProportion() {
        return performanceProportion;
    }

    public BusinessReferral setPerformanceProportion(Long performanceProportion) {
        this.performanceProportion = performanceProportion;
        return this;
    }

    public Long getTcProportion() {
        return tcProportion;
    }

    public BusinessReferral setTcProportion(Long tcProportion) {
        this.tcProportion = tcProportion;
        return this;
    }

    public String getCostomerDemand() {
        return costomerDemand;
    }

    public BusinessReferral setCostomerDemand(String costomerDemand) {
        this.costomerDemand = costomerDemand;
        return this;
    }

    public String getRemark() {
        return remark;
    }

    public BusinessReferral setRemark(String remark) {
        this.remark = remark;
        return this;
    }

    public Long getReferralUserId() {
        return referralUserId;
    }

    public BusinessReferral setReferralUserId(Long referralUserId) {
        this.referralUserId = referralUserId;
        return this;
    }

    public String getReferralUserName() {
        return referralUserName;
    }

    public BusinessReferral setReferralUserName(String referralUserName) {
        this.referralUserName = referralUserName;
        return this;
    }

    public Long getReceiveUserId() {
        return receiveUserId;
    }

    public BusinessReferral setReceiveUserId(Long receiveUserId) {
        this.receiveUserId = receiveUserId;
        return this;
    }

    public String getReceiveUserName() {
        return receiveUserName;
    }

    public BusinessReferral setReceiveUserName(String receiveUserName) {
        this.receiveUserName = receiveUserName;
        return this;
    }

    public Integer getIsReceive() {
        return isReceive;
    }

    public BusinessReferral setIsReceive(Integer isReceive) {
        this.isReceive = isReceive;
        return this;
    }

    public String getCurrentReturnUserName() {
        return currentReturnUserName;
    }

    public BusinessReferral setCurrentReturnUserName(String currentReturnUserName) {
        this.currentReturnUserName = currentReturnUserName;
        return this;
    }

    public Long getCurrentReturnUserId() {
        return currentReturnUserId;
    }

    public BusinessReferral setCurrentReturnUserId(Long currentReturnUserId) {
        this.currentReturnUserId = currentReturnUserId;
        return this;
    }

    public Date getReturnTime() {
        return returnTime;
    }

    public BusinessReferral setReturnTime(Date returnTime) {
        this.returnTime = returnTime;
        return this;
    }

    public Integer getReturnNum() {
        return returnNum;
    }

    public BusinessReferral setReturnNum(Integer returnNum) {
        this.returnNum = returnNum;
        return this;
    }

    public Long getReferralOrgId() {
        return referralOrgId;
    }

    public BusinessReferral setReferralOrgId(Long referralOrgId) {
        this.referralOrgId = referralOrgId;
        return this;
    }

    public Long getReceiveOrgId() {
        return receiveOrgId;
    }

    public BusinessReferral setReceiveOrgId(Long receiveOrgId) {
        this.receiveOrgId = receiveOrgId;
        return this;
    }

    public Long getCurrentReturnOrgId() {
        return currentReturnOrgId;
    }

    public BusinessReferral setCurrentReturnOrgId(Long currentReturnOrgId) {
        this.currentReturnOrgId = currentReturnOrgId;
        return this;
    }

    public Integer getIsFa() {
        return isFa;
    }

    public BusinessReferral setIsFa(Integer isFa) {
        this.isFa = isFa;
        return this;
    }

    public Integer getTcred() {
        return tcred;
    }

    public BusinessReferral setTcred(Integer tcred) {
        this.tcred = tcred;
        return this;
    }

    public BigDecimal getRed() {
        return red;
    }

    public BusinessReferral setRed(BigDecimal red) {
        this.red = red;
        return this;
    }

    public BigDecimal getIstcred() {
        return istcred;
    }

    public BusinessReferral setIstcred(BigDecimal istcred) {
        this.istcred = istcred;
        return this;
    }

    public Date getFaTime() {
        return faTime;
    }

    public BusinessReferral setFaTime(Date faTime) {
        this.faTime = faTime;
        return this;
    }

    public Date getReferralTime() {
        return referralTime;
    }

    public void setReferralTime(Date referralTime) {
        this.referralTime = referralTime;
    }

    public Long getCustomerId() {
        return customerId;
    }

    public void setCustomerId(Long customerId) {
        this.customerId = customerId;
    }

    public Integer getReferralAuditStatus() {
        return referralAuditStatus;
    }

    public void setReferralAuditStatus(Integer referralAuditStatus) {
        this.referralAuditStatus = referralAuditStatus;
    }

    public Integer getCreateType() {
        return createType;
    }

    public void setCreateType(Integer createType) {
        this.createType = createType;
    }

    public Long getAuditUserId() {
        return auditUserId;
    }

    public void setAuditUserId(Long auditUserId) {
        this.auditUserId = auditUserId;
    }

    public String getReferralType() {
        return referralType;
    }

    public void setReferralType(String referralType) {
        this.referralType = referralType;
    }
}